/*
 * This project provides a number of implementations for indexing and evaluating
 * <i>Continuous Top-k Queries over Text Streams</i>
 * and has been developped as part of the work described in the article:
 * 
 * Vouzoukidou, N., Amann, B., & Christophides, V. (2012, October). 
 * Processing continuous text queries featuring non-homogeneous scoring functions.
 * In Proceedings of the 21st ACM international conference on Information and 
 * knowledge management (pp. 1065-1074). ACM.
 * http://dl.acm.org/citation.cfm?id=2398404
 * 
 * This software is distributed under the GNU General Public License and as an
 * additional condition of usage, please cite the aforementioned article.
 * 
 * Copyright (C) 2012 ICS/FORTH, Greece and 
 *               2012 LIP6, France
 * 
 * Author: Vouzoukidou Nelly, email: nelly.vouzoukidou (at) gmail (dot) com
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
package gr.forth.ics.continuoustopk;

import gr.forth.ics.continuoustopk.index.UpdatedQueriesConstraint;
import gr.forth.ics.continuoustopk.metrics.ScoringStrategy;
import gr.forth.ics.continuoustopk.metrics.DecayFunction;
import gr.forth.ics.continuoustopk.metrics.RankingFunction;
import gr.forth.ics.continuoustopk.metrics.SimilarityMetric;
import java.util.Random;

/**
 * Defining all constants of the problem.
 * An initialization prints all constants.
 * <b> Important:</b> make sure time to print is not calculated in time experiments
 *
 * @author Vouzoukidou Nelly, email: nelly.vouzoukidou (at) gmail (dot) com
 */
public class Constants {

    private Constants() {}

    public static Random random = new Random(0);
    
    // "constants" to be varying in the experiments
    public static final RankingFunction rankingFunction = RankingFunction.weightedSum;
    public static final SimilarityMetric similarityFunction = SimilarityMetric.Product;
    
    public final static ScoringStrategy itemScoreStrategy = ScoringStrategy.zero;
    public final static ScoringStrategy queryScoreStrategy = ScoringStrategy.zero;
    public final static int maxQuerySize = 4;
    public final static double alpha = 0.0;
    public final static double beta = 1.0;
    public final static DecayFunction decay = DecayFunction.noDecay();
    public final static int k = 1;
    
    // line constraints
    public static final UpdatedQueriesConstraint primaryConstraint = UpdatedQueriesConstraint.byMaxPotentialScore;
    public static final UpdatedQueriesConstraint secondaryConstraint = UpdatedQueriesConstraint.moreThanAverage;
    public static final UpdatedQueriesConstraint pointConstraint = UpdatedQueriesConstraint.combined(primaryConstraint, secondaryConstraint);

    // assistive methods
    public static boolean isUpdated(Query query, Item item) {
        return rankingFunction.score(query, item) > query.minScore();
    }
    
    static {
//        System.err.println("Constants");
//        System.err.println("alpha=" + alpha);
//        System.err.println("beta=" + beta);
//        System.err.println("decay=" + decay);
//        System.err.println("k=" + k);
    }
}
